﻿using System;
using System.Collections.Generic;
using SimpleServiceBus.Endpoint;

namespace SimpleServiceBus.Bus.Pipeline
{
    public interface IMessagePipeline : IDisposable
    {
        PipelineDirection PipelineDirection { get; }
        IMessageContext CurrentContext { get; }
        IMessagePipelineComponent CurrentComponent { get; }

        IMessagingEndpoint Endpoint { get; }
        IList<IMessagePipelineComponent> PipelineComponents { get; }

        IPipelineEvents PipelineEvents { get; }

        void Initialize(MessageEnvelope messageEnvelope, IMessagingEndpoint endpoint, PipelineDirection direction,
                        params IMessagePipelineComponent[] components);

        void ProcessMessage();
    }
}